import time
class mah_timer:
    def __init__(self):
        self.frameCount = 0
        self.startTime = time.time()
    def reached(self,end):
        self.cTime = time.time() - self.startTime
        if self.cTime >= end:
            return True
        else:
            return False
    def limitFps(self,fps):
        if self.reached(1):
            self.frameCount = 0
            self.reset()
        else:
            if self.frameCount < fps:
                self.frameCount = self.frameCount + 1
                print "FPS:" + str(self.frameCount)
                return True
            else:
                return False
    def reset(self):
        self.cTime == 0
        self.startTime = time.time()
